//
//  CaseCell.m
//  MyDIYHouse
//
//  Created by dllo on 15/6/30.
//  Copyright (c) 2015年 李平洋. All rights reserved.
//

#import "CaseCell.h"

@implementation CaseCell

-(void)dealloc
{
    [_furnitureImage release];
    [_commentNumLable release];
    [_likedView release];
    [_commentView release];
    [_titleLable release];
    [_dateLable release];
    [_likeNumLable release];
    [_commentNumLable release];
    [super dealloc];
    
    
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self.contentView.backgroundColor=[UIColor grayColor];
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.furnitureImage=[[UIImageView alloc]init];
        //        self.furnitureImage.layer.borderWidth=1;
        self.furnitureImage.layer.cornerRadius=5;
        //        self.furnitureImage.backgroundColor=[UIColor cyanColor];
        [self.contentView addSubview:self.furnitureImage];
        [self.furnitureImage release];
        //改成了button点击会跳入不同的界面
        self.peopleImageButton=[UIButton buttonWithType:UIButtonTypeCustom];
        //        self.peopleImageButton.layer.borderWidth=0;
        self.peopleImageButton.frame=CGRectMake(0, 0, self.contentView.frame.size.width/4, 50);
        //        self.peopleImageButton.backgroundColor=[UIColor redColor];
        [self.contentView addSubview:self.peopleImageButton];
        
        
        self.likedView=[[UIImageView alloc]init];
        //        self.likedView.layer.borderWidth=1;
        //        self.likedView.backgroundColor=[UIColor grayColor];
        //在评论数和喜欢数处贴上图片
        [self.likedView setImage:[UIImage imageNamed:@"likeSmallIconGrey"]];
        [self.contentView addSubview:self.likedView];
        [_likedView release];
        
        self.commentView=[[UIImageView alloc]init];
        [self.commentView setImage:[UIImage imageNamed:@"comment_SmallIconGrey"]];
        //        self.commentView.layer.borderWidth=1;
        //        self.commentView.backgroundColor=[UIColor grayColor];
        [self.contentView addSubview:self.commentView];
        [_commentView release];
        
        self.titleLable=[[UILabel alloc]init];
        self.titleLable.font=[UIFont systemFontOfSize:20];
        //        self.titleLable.layer.borderWidth=1;
        //        self.titleLable.backgroundColor=[UIColor greenColor];
        [self.contentView addSubview:self.titleLable];
        [_titleLable release];
        
        self.dateLable=[[UILabel alloc]init];
        self.dateLable.font=[UIFont systemFontOfSize:20];
        //        self.dateLable.backgroundColor=[UIColor purpleColor];
        [self.contentView addSubview:self.dateLable];
        [_dateLable release];
        
        self.likeNumLable=[[UILabel alloc]init];
        self.likeNumLable.font=[UIFont systemFontOfSize:20];
        //        self.likeNumLable.layer.borderWidth=1;
        //        self.likeNumLable.backgroundColor=[UIColor yellowColor];
        [self.contentView addSubview:self.likeNumLable];
        [_likeNumLable release];
        
        self.commentNumLable=[[UILabel alloc]init];
        self.commentNumLable.font=[UIFont systemFontOfSize:20];
        //        self.commentNumLable.layer.borderWidth=1;
        //        self.commentNumLable.backgroundColor=[UIColor yellowColor];
        [self.contentView addSubview:self.commentNumLable];
        [_commentNumLable release];
        
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.furnitureImage.frame=CGRectMake(10, 5, self.contentView.frame.size.width-20, 138);
    self.peopleImageButton.frame=CGRectMake(30, 120, (self.contentView.frame.size.width-20)/5, (self.contentView.frame.size.width-20)/5);
    self.likedView.frame=CGRectMake(220, 173, 15, 15);
    self.commentView.frame=CGRectMake(260, 173, 15, 15);
    self.titleLable.frame=CGRectMake(105, 140, self.contentView.frame.size.width-20-(self.contentView.frame.size.width-20)/5-30, (self.contentView.frame.size.width-20)/5/3);
    self.dateLable.frame=CGRectMake(105, 170, 100, 20);
    self.likeNumLable.frame=CGRectMake(240, 173, 15, 15);
    self.commentNumLable.frame=CGRectMake(280, 173, 15, 15);
    //编辑文字大小
    self.dateLable.font=[UIFont boldSystemFontOfSize:12];
    self.titleLable.font=[UIFont boldSystemFontOfSize:16];
    self.likeNumLable.font=[UIFont boldSystemFontOfSize:12];
    self.commentNumLable.font=[UIFont boldSystemFontOfSize:12];
    //编辑文字颜色
    self.dateLable.textColor=[UIColor grayColor];
    self.titleLable.textColor=[UIColor blackColor];
    self.likeNumLable.textColor=[UIColor grayColor];
    self.commentNumLable.textColor=[UIColor grayColor];
    
    
    
    
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
